package sun.springboot.mqtt_integration.core.messageHandle;

import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * 数据处理实现
 */
@Slf4j
@Component
public class AbsTopicScreenDetailsImpl extends AbsTopicScreenDetails {
    Logger logger = LoggerFactory.getLogger(AbsTopicScreenDetailsImpl.class);


    @Override
    public void receive() {
        logger.info("设备上传信息{}", JSON.parseObject(super.message.getPayload().toString(), String.class));

    }

    @Override
    public void will() {
        logger.info("设备关机{}", JSON.parseObject(super.message.getPayload().toString(), String.class));

    }

    @Override
    public void charge() {
        logger.info("设备充电{}", JSON.parseObject(super.message.getPayload().toString(), String.class));

    }
}

